/*
 * @Author: intellectual-seeker 3336339701@qq.com
 * @Date: 2025-11-15 20:07:36
 * @LastEditors: intellectual-seeker 3336339701@qq.com
 * @LastEditTime: 2025-11-17 14:45:47
 * @FilePath: /code/lesson34/udp_echo_server/Main.cc
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
#include "UdpServer.hpp"
#include <memory>
#include <iostream>

void Usage(string proc)
{
    std::cout << "Usage:\t\n" << proc << " local_port\n" << std::endl; 
}

int main(int argc, char* argv[])
{
    if(argc != 2)
    {
        Usage(argv[0]);
        exit(USAGE_ERROR);
    }

    EnableScreen();

    uint16_t port = std::stoi(argv[1]);
    std::unique_ptr<UdpServer> usvr = std::make_unique<UdpServer>(port);
    usvr->InitServer();
    usvr->Start();

    return 0;
}